<?php
header("Access-Control-Allow-Origin:*");
require("../lib/init.php");
require("../pojo/token.php");
$token = $_POST['token'];
$id = $_POST['id'];
if (empty($token) or empty($id)){
    exit("缺少必要参数");
}
if (!checkToken($token)) {
    $code = 400;
    $msg = "没有权限";
} else {
    $sql = "delete from employee where id = '$id'";
    if (!MQuery($sql)) {
        $code = 400;
        $msg = "删除失败！";
    } else {
        $code = 200;
        $msg = "删除成功！";
    }
}

echo json_encode(resultmsg($code,$msg));